package com.gxgeek.redis.application.application.uniqueidentifier;

import redis.clients.jedis.JedisPoolConfig;

/**
 * @author gaoxing
 * @create 2018-01-03 下午4:04
 */
public class RedisConnectionUtil {
    public static RedisConnection create() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxTotal(50);
        jedisPoolConfig.setMaxIdle(10);
        jedisPoolConfig.setMinIdle(1);
        RedisConnection redisConnection = new RedisConnection();
        redisConnection.setIp("127.0.0.1");
        redisConnection.setPort(6379);
//        redisConnection.setPwd("hhSbcpotThgWdnxJNhrzwstSP20DvYOldkjf");
        redisConnection.setClientName(Thread.currentThread().getName());
        redisConnection.setTimeOut(600);
        redisConnection.setJedisPoolConfig(jedisPoolConfig);
        return redisConnection;
    }
}
